package com.rocket.bedroom.config;

import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.apache.shiro.web.util.WebUtils;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class ShiroFormAuthenticationFilter extends FormAuthenticationFilter
{
    @Override
    protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, ServletRequest request, ServletResponse response) throws Exception {
        System.out.println("------------------------");
        String successUrl = "/register";//我是直接写死了跳转链接

        WebUtils.issueRedirect(request,response,successUrl);

        return false;//返回false表示执行链结束
    }
}